<?
	session_start();
	include ("ham.php");
	require_once("connect.php");
?>
<?
	{
	if($_POST['username']!="" and $_POST['password']!="")
	{
		$u=$_POST['username'];
		$p=$_POST['password'];
		echo $u;
		echo $p;
		$tv="select count(*) from adminx where usernamex='$u' and passwordx='$p'";
		$tv_1=mysql_query($tv);
		$tv_2=mysql_fetch_row($tv_1);
		echo $tv_2['usernamex'];
		if($tv_2!=0)
		{
			$_SESSION['user']=$u;
			$_SESSION['pass']=$p;
		}
		else
		{
			thongbao("Sai username hoặc password!");
		}
	}
	else
	{
		thongbao("Username và Password không được bỏ trống");
	}
	backpages();
	exit();
	}
	$user_s=$_SESSION['user'];
	$pass_s=$_SESSION['pass'];
	if($user_s!="" and $pass_s!="")
	{
		$tv="select count(*) from adminx where usernamex='$user_s' and passwordx='$pass_s'";
		$tv_1=mysql_query($tv);
		$tv_2=mysql_fetch_row($tv_1);
		if($tv_2!=0)
		{
			$_SESSION['checklogin'] ="true";
		}
	}
	else
	{
		$_SESSION['checklogin'] ="false";
	}
?>